package com.ding.es.entity;

import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import javax.persistence.Id;
import java.util.Date;
import java.util.List;

/**
 * @author ding
 * @date 2021/8/22 15:26
 */

@Data
@Document(indexName = "film", shards = 1, replicas = 0, createIndex = true)
public class ESFilm {
    @Id
    private Integer id;

    @Field(value = "all",analyzer = "ik_max_word")
    private String all;

    @Field(name = "ranking", type = FieldType.Integer)
    private Integer ranking;

    @Field(name = "title", type = FieldType.Text, index = true, analyzer = "ik_max_word")
    private String title;

    @Field(name = "href", type = FieldType.Text, index = false)
    private String href;
    @Field(name = "img", type = FieldType.Text, index = false)
    private String img;

    @Field(name = "type", type = FieldType.Keyword)
    private List<String> type;

    @Field(name = "director", type = FieldType.Keyword)
    private String director;

    @Field(name = "score", type = FieldType.Float)
    private String score;

    @Field(name = "country")
    private List<String> country;

    @Field(name = "sj")
    private Date date;
    @Field(name = "content", analyzer = "ik_max_word")
    private String content;
    @Field(name = "actors")
    private List<String> actors;
}
